Picture Shapes
Picture shapes contain collections of other shapes. They allow you to gather disparate elements together inside a single shape.You can use picture shapes for many reasons, including to group a page of shapes together for printing, to provide a grouping feature in a graphics application, or to simplify your programming by gathering a number of shapes together and applying modifications to the group as a whole.
Figure 1-14 shows three sample picture shapes:
Figure 1-14 Sample picture shapes
- The first picture shape combines a number of geometric shapes--rectangles, polygons, and paths--into one picture.
- The second picture shape includes a bitmap shape as well--the lawn is a gradient, or ramp, which fades from dark to light.
- The third picture shape includes typographic shapes in the picture as well.
Like bitmap shapes, picture shapes make extensive use of their geometry property. A picture shape uses its geometry property to store a list of references to the shapes to be included the picture. Although each of these shapes has its own style, ink, and transform object, picture shapes allow you to provide an overriding style, ink, and transform object to use for each of these shapes.
Figure 1-15 shows a hierarchical view of the first picture shape shown in Figure 1-14.
The picture contains two items: each of which is a picture shape itself. The first item is a picture that contains two items: the lawn and the walkway. The second item is a picture that contains four items: the chimney, the house, the door, and the roof.Figure 1-15 A picture hierarchy
Notice that the order the shapes appear in the geometry is the order in which QuickDraw GX draws them, from back to front.
Since picture shapes contain other shapes, they don't make much use of their shape fill property, although you can specify a no-fill shape fill if you don't want the picture to appear when drawn.
Picture shapes also don't make much use of their associated style or ink objects, since each shape in the picture has its own style object and ink object, and, potentially, an overriding style and ink object.
Picture shapes do make full use of their transform objects, however. For example, you can scale, skew, rotate, and clip picture shapes as a whole, as well as separately for each individual shape in the picture. QuickDraw GX also provides powerful tools for hit-testing picture shapes.
For more information about picture shapes, see the chapter "Picture Shapes" in this book.
Main | Page One | What's New | Apple Computer, Inc. | Find It | Contact Us | Help